package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.SysUserControllerApi;
import com.nineclock.system.dto.SysRegisterDTO;
import com.nineclock.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class SysUserController implements SysUserControllerApi {

    @Autowired
    private SysUserService sysUserService;

    @Override
    @PostMapping("/register")
    public Result register( SysRegisterDTO sysRegisterDTO) {
        Long userId = sysUserService.regiester(sysRegisterDTO);
        return Result.success(userId);
    }
}
